<template>
  <div>
    <button @click="$emit('some-event', 'msg from grandson1')">
      grandson1点击
    </button>
    <hr />
    <grandsonson1
      v-on="$listeners"
      v-bind="$attrs"
      msg2="qiuqiu"
      info='v-bind="$attrs" 如果底层组件属性和父级属性相同则会覆盖父级'
    />
  </div>
</template>
<script>
import grandsonson1 from './grandsonson1.vue'
export default {
  name: 'grandSonone',
  components: { grandsonson1 },
  data() {
    return {
      name: 'grandson1'
    }
  },
  created() {
    // 和兄弟传数据的例子
    this.$parent.$on('grandson2Emit', (val) => {
      console.log(val)
    })
  },
  mounted() {
    console.log(this.$attrs)
    console.log('grandson1_$listeners', this.$listeners)
  },
  methods: {},
  activated: {},
  deactivated: {}
}
</script>
<style lang="less" scoped></style>
